/* 自定义Markdown样式，移除默认背景色 */
.markdown-body {
  background-color: transparent !important;
  color: inherit !important;
}

/* 确保链接颜色在不同主题下都清晰可见 */
.markdown-body a {
  color: #0969da;
}

/* 在暗色主题下使用更明亮的链接颜色 */
@media (prefers-color-scheme: dark) {
  .markdown-body a {
    color: #58a6ff;
  }

  .markdown-body img {
    filter: brightness(0.8) contrast(1.2);
  }

  .markdown-body pre,
  .markdown-body code {
    background-color: rgba(240, 240, 240, 0.15) !important;
  }
}

/* 确保代码块和表格在不同主题下都可读 */
.markdown-body pre,
.markdown-body code {
  background-color: rgba(27, 31, 35, 0.05) !important;
}

.markdown-body table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 16px;
}

.markdown-body table th,
.markdown-body table td {
  border: 1px solid #ddd;
  padding: 8px;
}

/* 适配暗色主题 */
@media (prefers-color-scheme: dark) {

  .markdown-body table th,
  .markdown-body table td {
    border-color: #444;
  }
}

/* 确保块引用在不同主题下的样式 */
.markdown-body blockquote {
  border-left: 4px solid #ddd;
  padding-left: 16px;
  color: inherit;
}

@media (prefers-color-scheme: dark) {
  .markdown-body blockquote {
    border-left-color: #444;
  }
}

/* 确保标题在不同主题下都清晰 */
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  color: inherit;
  border-bottom-color: rgba(0, 0, 0, 0.2);
}

@media (prefers-color-scheme: dark) {

  .markdown-body h1,
  .markdown-body h2,
  .markdown-body h3,
  .markdown-body h4,
  .markdown-body h5,
  .markdown-body h6 {
    border-bottom-color: rgba(255, 255, 255, 0.2);
  }
}